<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/components/APP/Report/Main/EnergyConsumption.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\..\index.html">All files</a> / <a href="index.html">src/components/APP/Report/Main</a> EnergyConsumption.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/22</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/6</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/11</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/22</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
  &lt;div o-Container o-Container-App&gt;
    &lt;van-nav-bar title="电量趋势统计" left-arrow @click-left="onClickLeft" v-bind="{fixed:true}"/&gt;
    &lt;div class="content"&gt;
      &lt;div class="containerMask"&gt;&lt;/div&gt;
      &lt;van-cell-group&gt;
        &lt;div class="title123" &gt;&lt;span @click="goLastYear()" class="icon icon-fanhui leftSpan"&gt;&lt;/span&gt;{{year}}年&lt;span @click="goNextYear()" class="icon icon-fanhui rightSpan"&gt;&lt;/span&gt;&lt;/div&gt;
      &lt;/van-cell-group&gt;
      &lt;div class="energyBox"&gt;
        &lt;div class="title"&gt;电量统计趋势（公区）&lt;/div&gt;
        &lt;div id="energyStatistics"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;van-cell-group v-for="(item,index) in energyMsg" :key="index"&gt;
        &lt;div class="title"&gt;&lt;span&gt;{{item.product}}&lt;/span&gt; &lt;span&gt;{{item.profitMsg}}kWh&lt;/span&gt;&lt;/div&gt;
        &lt;div class="expenditure"&gt;预算：{{item.expenditure}}kWh&lt;span&gt;占比：{{item.Proportion}}&lt;/span&gt;&lt;/div&gt;
        &lt;div class="expenditure"&gt;去年：{{item.income}}kWh &lt;span&gt;同比：{{item.YearOnYear}}&lt;/span&gt;&lt;/div&gt;
        &lt;div class="income"&gt;上月：{{item.profitMsg}}kWh &lt;span&gt;环比：{{item.ChainRatio}}&lt;/span&gt;&lt;/div&gt;
      &lt;/van-cell-group&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/template&gt;
&nbsp;
&lt;script&gt;
    export default {
        name: "mms_engine_database_item", /* 这个name暂时不知道用啥用，根据官方文档说的是方便排错的 */
<span class="fstat-no" title="function not covered" >        data() {</span>
<span class="cstat-no" title="statement not covered" >            return {</span>
                octopus: this.$parent.octopus,
                year:2019,
                energyMsg:[
                    {'product':'一月','income':'346,303','expenditure':'354,520','Proportion':'92%',profitMsg:'535,203',YearOnYear:'88%',ChainRatio:'90%'},
                    {'product':'二月','income':'346,303','expenditure':'454,520','Proportion':'90%',profitMsg:'535,203',YearOnYear:'90%',ChainRatio:'91%'},
                    {'product':'三月','income':'346,303','expenditure':'454,520','Proportion':'92%',profitMsg:'565,203',YearOnYear:'87%',ChainRatio:'89%'},
                    {'product':'四月','income':'346,303','expenditure':'554,520','Proportion':'85%',profitMsg:'935,203',YearOnYear:'91%',ChainRatio:'92%'},
                    {'product':'五月','income':'346,303','expenditure':'954,520','Proportion':'87%',profitMsg:'835,203',YearOnYear:'92%',ChainRatio:'91%'},
                    {'product':'六月','income':'346,303','expenditure':'654,520','Proportion':'92%',profitMsg:'865,203',YearOnYear:'95%',ChainRatio:'93%'},
                    {'product':'七月','income':'346,303','expenditure':'454,520','Proportion':'94%',profitMsg:'935,203',YearOnYear:'89%',ChainRatio:'94%'},
                    {'product':'八月','income':'346,303','expenditure':'454,520','Proportion':'90%',profitMsg:'435,203',YearOnYear:'90%',ChainRatio:'92%'},
                    {'product':'九月','income':'746,303','expenditure':'454,520','Proportion':'88%',profitMsg:'135,203',YearOnYear:'93%',ChainRatio:'89%'},
                    {'product':'十月','income':'646,303','expenditure':'454,520','Proportion':'88%',profitMsg:'535,203',YearOnYear:'94%',ChainRatio:'86%'},
                    {'product':'十一月','income':'246,303','expenditure':'454,520','Proportion':'89%',profitMsg:'398,203',YearOnYear:'92%',ChainRatio:'96%'},
                    {'product':'十二月','income':'5846,303','expenditure':'454,520','Proportion':'93%',profitMsg:'835,203',YearOnYear:'96%',ChainRatio:'92%'},
                ],
            }
        },
<span class="fstat-no" title="function not covered" >        mounted(){</span>
<span class="cstat-no" title="statement not covered" >            let o=this;</span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >            $(window).resize(function () {</span></span>
<span class="cstat-no" title="statement not covered" >                if(o.EnergyStatistics) {</span>
<span class="cstat-no" title="statement not covered" >                    o.EnergyStatistics.resize();</span>
                }
            });
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >            setTimeout(function () {</span></span>
<span class="cstat-no" title="statement not covered" >                o.energyStatistics();</span>
            },500);
        },
        methods: {
            // 保存后回调事件，主控件为主的，子控件依赖主控件的，可在主控件保存后调用子控件的save。
            // 回调时因为数据是全部钩子动态绑定的，唯独因为创建会把保存类型给冲掉，所以这样要回传保存的类型
<span class="fstat-no" title="function not covered" >            save: function (data) {</span>
<span class="cstat-no" title="statement not covered" >                if (data.status.code == 200) {</span>
<span class="cstat-no" title="statement not covered" >                    this.octopus.tips.info("[" + data.status.code + "] Data Save Success.");</span>
                }
            },
            //上一年
<span class="fstat-no" title="function not covered" >            goLastYear(){</span>
<span class="cstat-no" title="statement not covered" >                this.year--;</span>
            },
            //下一年
<span class="fstat-no" title="function not covered" >            goNextYear(){</span>
<span class="cstat-no" title="statement not covered" >                let date=new Date;</span>
<span class="cstat-no" title="statement not covered" >                let y = date.getFullYear();</span>
<span class="cstat-no" title="statement not covered" >                if(this.year &gt;= y){</span>
<span class="cstat-no" title="statement not covered" >                    this.year = y;</span>
                }else {
<span class="cstat-no" title="statement not covered" >                    this.year++;</span>
                }
            },
<span class="fstat-no" title="function not covered" >            back: function () {</span>
<span class="cstat-no" title="statement not covered" >                this.octopus.router.jump("/MMS/Engine/Database/List");</span>
            },
<span class="fstat-no" title="function not covered" >            click: function (param) {</span>
<span class="cstat-no" title="statement not covered" >                console.log(param);</span>
            },
<span class="fstat-no" title="function not covered" >            onClickLeft() {</span>
<span class="cstat-no" title="statement not covered" >                this.octopus.router.jump('/APP/Report/Main/Page')</span>
            },
            // 柱状图
<span class="fstat-no" title="function not covered" >            energyStatistics(){</span>
<span class="cstat-no" title="statement not covered" >                let o = this;</span>
<span class="cstat-no" title="statement not covered" >                o.EnergyStatistics = o.$echarts.init(document.getElementById('energyStatistics'));</span>
<span class="cstat-no" title="statement not covered" >                let option = {</span>
                    tooltip: {
                        show: true,
                        // formatter: '{b}: &lt;br /&gt;{c}'
                    },
                    grid: {
                        left: '6%',
                        right: '6%',
                        bottom: '60px',
                        top:"4%",
                        containLabel: true
                    },
                    legend:{
                        textStyle: {
                            color: '#595D62',// 图例文字颜色
                            fontSize:10,
                            letterSpacing:0
                        },
                        icon:'react',
                        itemWidth:10,//图例的宽度
                        itemHeight:10,//图例的高度
                        bottom: 10,
                        left: 'center',
                    },
                    color: ['#0089FF', '#FE9F00','#FE2938'],
                    barWidth: 15,
                    xAxis: {
                        data: ['01','02','03','04','05','06','07','08','09','10','11','12',],
                        // show:false,
                        axisLabel: {
                            inside: true,
                            textStyle: {
                                color: '#333333'
                            }
                        },
                        offset:35,
                        axisLine:{
                            show:false,
                            lineStyle:{
                                color:'#333333',
                                width:2,//这里是为了突出显示加上的
                            }
                        },
                        axisTick: {
                            show:false,
                        },
                        TextStyle: {
                            color: '#000000'
                        }
                    },
                    yAxis: {
                        axisLine:{
                            show: false,
                            lineStyle:{
                                show:'false',
                                color:'#333333',
                                width:2,//这里是为了突出显示加上的
                            }
                        },
                        splitLine: {
                            show: true,
                            lineStyle:{
                                color: ['#EDEDED'],
                                width: 1,
                                type: 'solid'
                            }
                        },
                        axisLabel:{
                            show:true,
                            textStyle: {
                                fontSize: 8,
                                color:'#595D62'
                            }
                        },
                        axisTick: {
                            show:false,
                        },
                    },
                    series: [
                        {name: "0-80%",barGap: "-100%",type: "bar",data:[43390, 56509, 0, 0, 0, 0, 0, 0, 0, 58466, 54950, 37244]},
                        {name: "80%-100%",barGap: "-100%",type: "bar",data:[0, 0, 0, 60151, 70812, 60812, 0, 0, 0, 0, 0, 0]},
                        {name: "&gt;100%",barGap: "-100%",type: "bar",data:[0, 0, 92557, 81644, 0, 0, 92115, 88505, 91296, 0, 0, 0]},
                    ]
                };
<span class="cstat-no" title="statement not covered" >                o.EnergyStatistics.setOption(option);</span>
            },
        },
        props: ["oData"]
    }
&lt;/script&gt;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Jan 20 2020 17:54:15 GMT+0800 (GMT+08:00)
</div>
</div>
<script src="..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\..\sorter.js"></script>
</body>
</html>
